﻿@model  BankData 
<fieldset>
    <legend>@Html.DisplayNameFor(m => m)</legend>
    @Html.DisplayForModel()
</fieldset>
@if (Model.DisputeApply != null && Model.DisputeApply.Count > 0)
{ 
    <fieldset>
        <legend>争议记录</legend>
        <table class="table">
            <thead>
                <tr>
                    <th>
                        原因
                    </th>
                    <th>
                        申请人
                    </th>
                    <th>
                        状态
                    </th>
                    <th>
                        操作
                    </th>
                </tr>
            </thead>
            <tbody id="disputeListBody" targeturl='@Url.Action("SimpleDisputeList", new { controller = "DisputeApply", id = Model.Id })'>
                @Html.Partial("SimpleDisputeList", Model.DisputeApply)
            </tbody>
        </table>
    </fieldset>

}
@if (Model.CheckRecord.Count > 0)
{
    foreach (var cr in Model.CheckRecord)
    {    
        <fieldset id="@cr.Id">
        <legend>@BindDropDownList.GetUserName(cr.ApplyMan) 签出 
        @Html.ShortcutLink("删除签出", "DeleteCheckRecord", new { controller = "BankData", id = cr.Id }, "deleteCheckRecord") </legend>
        @if (Model.PaymentApply.Count(s => s.CheckRecordID == cr.Id) > 0)
        {
            <fieldset>
                <legend>认款记录</legend>
                <table class="table">
                    <thead>
                        <tr>
                            <th>
                                金额
                            </th>
                            <th>
                                申请人
                            </th>
                            <th>
                                状态
                            </th>
                            <th>
                                操作
                            </th>
                        </tr>
                    </thead>
                    @foreach (var item in Model.PaymentApply.Where(s => s.CheckRecordID == cr.Id))
                    {
                        <tbody>
                            <tr>
                                <td>
                                    @Html.DisplayFor(m => item.Amount)
                                </td>
                                <td>
                                    @BindDropDownList.GetUserName(item.ApplyMan)
                                </td>
                                <td>
                                    @BindDropDownList.ApprovalName(item.Status)
                                </td>
                                <td>@Html.ShortcutLink("删除", "Delete", new { controller = "PaymentApply", item.Id }, "DeleteTr")
                                </td>
                            </tr>
                        </tbody>
                    }
                </table>
            </fieldset>
        }
        @if (Model.RefundmentApply.Count(s => s.CheckRecordID == cr.Id) > 0)
        {
            <fieldset>
                <legend>退款记录</legend>
                <table class="table">
                    <thead>
                        <tr>
                            <th style="width: 80px">
                                金额
                            </th>
                            <td>
                                原因
                            </td>
                            <th style="width: 70px">
                                申请人
                            </th>
                            <th style="width: 40px">
                                状态
                            </th>
                            <th style="width: 80px">
                                操作
                            </th>
                        </tr>
                    </thead>
                    @foreach (var item in Model.RefundmentApply.Where(s => s.CheckRecordID == cr.Id))
                    {
                        <tbody>
                            <tr>
                                <td style="width: 80px">
                                    @Html.DisplayFor(m => item.Amount)
                                </td>
                                <td>@item.RefundmentReason
                                </td>
                                <td>
                                    @BindDropDownList.GetUserName(item.ApplyMan)
                                </td>
                                <td>
                                    @BindDropDownList.ApprovalName(item.Status)
                                </td>
                                <td>@Html.ShortcutLink("删除", "Delete", new { controller = "RefundmentApply", item.Id }, "DeleteTr")
                                </td>
                            </tr>
                        </tbody>
                    }
                </table>
            </fieldset>
        }
    </fieldset>
    }
}